![]() |
|
Need help with float values - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: PHP (https://sinister.ly/Forum-PHP) +--- Thread: Need help with float values (/Thread-Need-help-with-float-values) |
Need help with float values - Jacob - 09-20-2013 I'm dealing with huge numbers, which far exceed integer values. I'm having trouble figuring out exactly how to use floats. If you can help then please add my skype. skype: opie_son Thanks! RE: Need help with float values - Psycho_Coder - 09-20-2013 what programming language are you using. If you use python then python can handle very large integer values. Please give some example of what exactly is your requirement. RE: Need help with float values - invisal - 09-20-2013 (09-20-2013, 03:34 PM)Jacob Wrote: I'm dealing with huge numbers, which far exceed integer values. I'm having trouble figuring out exactly how to use floats. If you can help then please add my skype. How big? Do you care about performance? RE: Need help with float values - invisal - 09-20-2013 You can try these functions. Quite useful. It use string to represent large number. Code: <?php
$a = '24564641435345463424254686854646363636252525265768588';
$b = '54625264243535545453452321175765353454424568693422525';
var_dump(bcadd($a, $b)); // $a + $b, return string
var_dump(bcsub($a, $b)); // $a - $b, return string
var_dump(bcmul($a, $b)); // $a * $b, return string
var_dump(bcdiv($b, $a)); // $b / $a, return string
?>RE: Need help with float values - chmod - 09-20-2013 Marked solved and closed at the request of @Jacob |