RoundTo (Math) - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

RoundTo (Math)

I'm using the RoundTo function in the Math unit.

I get an "invalid floating point" error when I try to round a number like this
-7.4353333534E+35...

I think I get this because the roundto range of the function is 37, is that the case?, and if so, how do I round a number of that size?

thankx

-Delphi 7-

Comments

  • zibadianzibadian Posts: 6,349Member
    : I'm using the RoundTo function in the Math unit.
    :
    : I get an "invalid floating point" error when I try to round a number like this
    : -7.4353333534E+35...
    :
    : I think I get this because the roundto range of the function is 37, is that the case?, and if so, how do I round a number of that size?
    :
    : thankx
    :
    : -Delphi 7-
    :
    You cannot round a number of that size, since the Round() functions can only round to a maximum and minimum of about (-)9,223372036854775808e+18. This is the maximum of the Int64. If you want to round further, you must write your own function with bigger integers (such as an Int128) or google for such functions.
Sign In or Register to comment.