QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Pete on October 07, 2020, 07:18:04 pm

Title: Gonna take a CINT-a-mental journey..
Post by: Pete on October 07, 2020, 07:18:04 pm
Code: QB64: [Select]
  1. PRINT CINT(1 / 2) ' 0 Rounds down.
  2. PRINT CINT(2 / 2) ' 1
  3. PRINT CINT(3 / 2) ' 2 Rounds Up.
  4. PRINT CINT(4 / 2) ' 2
  5. PRINT CINT(5 / 2) ' 2 Rounds down.
  6. PRINT CINT(6 / 2) ' 3
  7. PRINT CINT(7 / 2) ' 4 Rounds Up.
  8. PRINT CINT(8 / 2) ' 4

What practical use does CINT have with this round up  then round down format?

Pete
Title: Re: Gonna take a CINT-a-mental journey..
Post by: _vince on October 07, 2020, 07:33:59 pm
Bilinear interpolation
Title: Re: Gonna take a CINT-a-mental journey..
Post by: Pete on October 07, 2020, 10:25:13 pm
Bipolar interrogation? That could get nasty.... no it couldn't, yes it could!

Pete
Title: Re: Gonna take a CINT-a-mental journey..
Post by: STxAxTIC on October 07, 2020, 10:30:10 pm
Quote
Bipolar interrogation? That could get nasty.... no it couldn't, yes it could!

i genuinely lolled at this!
Title: Re: Gonna take a CINT-a-mental journey..
Post by: bplus on October 07, 2020, 11:11:20 pm
Wait... it's not no it couldn't, yes it couldn't?

RE: OP
Luke apologized for the rounding as a Banker's method not wanting to show partiality so on average the accumulation of errors balance.