Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-access > #10354
| From | Neil <xxx@gmail.com> |
|---|---|
| Newsgroups | comp.databases.ms-access |
| Subject | Re: Weird Int Stuff |
| Date | 2015-02-14 21:22 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <mbp3br$vb8$1@dont-email.me> (permalink) |
| References | <mbp2o1$t3v$1@dont-email.me> |
On 2/14/2015 9:11 PM, Neil wrote:
> Can anyone explain to me why this is:
>
> ? int(760.025 * 100 + .5)
> 76002
>
> ? int(76002.5 + .5)
> 76003
>
> Same thing happens if you use fix. But clng gives 76003 in both cases.
And, to add to the weirdness, if I create a function and pass it the
760.025 value as a variant, it works correctly:
Function Temp(var As Variant) As Variant
Temp = Int(var * 100 + 0.5)
End Function
? temp(760.025)
76003
(But if I hard-code 760.025 into the function, instead of using the var
parameter, it then returns 76002 instead of 76003.)
Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Weird Int Stuff Neil <xxx@gmail.com> - 2015-02-14 21:11 -0600
Re: Weird Int Stuff Neil <xxx@gmail.com> - 2015-02-14 21:22 -0600
Re: Weird Int Stuff "Phil" <phil@stantonfamily.co.uk> - 2015-02-15 09:41 +0000
Re: Weird Int Stuff Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-02-15 10:41 -0800
Re: Weird Int Stuff Neil <xxx@gmail.com> - 2015-02-15 20:45 -0600
Re: Weird Int Stuff "Albert D. Kallal" <PleaseNOSpamkallal@msn.com> - 2015-02-15 22:04 -0700
csiph-web