Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.