[futurebasic] Re: [FB] INTs vs ROUND

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2001 : Group Archive : Group : All Groups

From: Chris Stasny <staz@...>
Date: Tue, 10 Jul 2001 11:40:43 -0500
>
>  >      I don't know any other way to explain this. Once you store a value as
>  >      a float, you may not ever be able to convert it to an integer again.
>
>All you need to do is add or subtract the maxErr# value from the number
>before converting:
>
>dim x#, x%, maxErr#
>window 1
>maxErr# = exp(-16)
>x# = 2-(1+.1+.1-.2)
>print using "#.#################"; x#; "  Raw number"
>x% = x#
>print x%; "  Unfloated, without maxErr#"
>x% = x# + maxErr#
>print x%;  "  Unfloated, with maxErr#"
>
>do
>handleevents
>until 0


I've never considered this. Looks interesting.



Best,

-STAZ  ~)~

800.348.2623 Orders  http://www.stazsoftware.com
228.255.7086 FAX     mailto:staz@...