Difference between float, double and real?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wander

    Difference between float, double and real?

    currently there are those functions is_float, is_double and is_real,
    which do exactly the same as far as i can see
    what surprises me is that $a = (float/double/real) 1; all work, while
    with settype() only float and double work, and 'real' not.
    now im wondering, is there any difference between those?

    and if not, will they all keep existing in php6? or will php continue
    with only one of them?
  • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

    #2
    Re: Difference between float, double and real?

    Wander wrote:
    what surprises me is that $a = (float/double/real) 1; [...]
    now im wondering, is there any difference between those?
    The amount of memory they need.

    --
    ----------------------------------
    Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

    "Las religiones, como las luciérnagas, necesitan de oscuridad para brillar"
    (Arthur Schopenhauer)

    Comment

    • Wander

      #3
      Re: Difference between float, double and real?

      On May 22, 5:12 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
      escomposlinux.-.punto.-.orgwrote:
      The amount of memory they need.
      thanks for your quick response, could you tell me which of the 3 takes
      the most memory, and which of them needs the least?

      Comment

      • ZeldorBlat

        #4
        Re: Difference between float, double and real?

        On May 22, 11:07 am, Wander <SIMS...@gmail. comwrote:
        currently there are those functions is_float, is_double and is_real,
        which do exactly the same as far as i can see
        what surprises me is that $a = (float/double/real) 1; all work, while
        with settype() only float and double work, and 'real' not.
        now im wondering, is there any difference between those?
        >
        and if not, will they all keep existing in php6? or will php continue
        with only one of them?
        They're all the same. According to the manual, both is_real() and
        is_double() are simply aliases for is_float(). Also, according to the
        manual, the "type" parameter to settype() takes "float" since PHP
        4.2.0 as the "double" variant was deprecated.

        Comment

        Working...