Re: [PHP] problem with string & floats in PHP




If you need precision with floats or doubles you can use BCMath
Arbitrary Precision Mathematics Functions.

http://www.php.net/manual/en/ref.bc.php

Andy

Pablo Luque wrote:
Hello, Im designing a website in which I have to read some data
(numbers) from a txt file and then send this data to a function which
prints a graphic with them. When I read the data I save it in an array
and the numbers are in this format: 5.812E-08. I have read the php
documentation about it, and I have use the example given there to
check which type is the data saved in the array. The response I got is
$vectorIc[1]== 5.812E-08 type is string

I dont understand why. In the documentation it is clear that this kind
of data should be considerer float, or thats what I understood. I cant
continue with my web designing if I dont get to turn the vector
elements into float numbers, because the function that prints the
graphic gives errors when recieving strings. I would be very thankful
if you could help me trying to solve this. In using PHP 4.4.7 and
Apache 2.0.59.

Thank you very much!

_________________________________________________________________
Descubre la descarga digital con MSN Music. Más de un millón de
canciones. http://music.msn.es/

.



Relevant Pages

  • Re: Why wont be
  • background span the whole background?
    ... Ive just noticed I am getting the dreaded horizontal scroll bar ... I dont have anything set to over 100% in width - what ... Im using an inline list for my horizontal navbar items with the right ... float: left, and then you can set the height on the to 23px. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: read binary data from C file???
    ... So you are ignoring the endian-ness issue completely, ... bytes after every float). ... Look in your compiler documentation and see exactly how it stores ... If the server is in your control then it's your responsibility ...
    (comp.lang.java.programmer)
  • Re: read binary data from C file???
    ... Steve Horsley wrote: ... > So you are ignoring the endian-ness issue completely, ... > bytes after every float). ... Compare this with the java documentation on how a DataInputStream ...
    (comp.lang.java.programmer)
  • Re: integer and floating point casts queries
    ... I went through following program in a C puzzle book. ... This should be available from your system's documentation or any reference ...
    (comp.lang.c)
  • Re: Compiler Code Optimization
    ... Roberto Della Pasqua wrote: ... > others dont' use this check that delphi.net open by deafult ...
    (borland.public.delphi.language.basm)

Loading