pike.git / lib / modules / Val.pmod

version» Context lines:

pike.git/lib/modules/Val.pmod:181:   //! @endcode   //!   //! That way it's possible for other code to replace it with an   //! extended class, or create their own variants which needs to behave   //! like @[Val.null].   //!   //! @fixme   //! The Oracle glue currently uses static null objects which won't be   //! affected if this object is replaced.    - //! The type for @[Val.nan]. + //! The type for @[nan].   class NaN {    constant is_val_nan = 1;       inline private int(0..1) `>(mixed that) {    return 0;    }       inline private int(0..1) `<(mixed that) {    return 0;    }
pike.git/lib/modules/Val.pmod:226:    return "";    }    return UNDEFINED;    }       private string _sprintf(int fmt) {    return "NaN";    }   }    - //! The type for @[Val.posinfty]. + //! The type for @[posinfty].   class PositiveInfinity {    constant is_val_positiveinfinity = 1;       inline private int(0..1) `<(mixed that) {    return 0;    }       inline private mixed `+(mixed that) {    return objectp(that)    && (([object]that)->is_val_negativeinfinity || ([object]that)->is_val_nan) -  ? Val.nan : this; +  ? nan : this;    }       inline private mixed `*(mixed that) { -  return !that ? Val.nan : that > 0 ? this : Val.neginfty; +  return !that ? nan : that > 0 ? this : neginfty;    }       inline private mixed `/(mixed that) {    return !that || objectp(that) && (([object]that)->is_val_positiveinfinity    || ([object]that)->is_val_negativeinfinity) -  ? Val.nan : that > 0 ? this : Val.neginfty; +  ? nan : that > 0 ? this : neginfty;    }       private int(0..1) `==(mixed that) {    return objectp(that) && [int(0..1)]([object]that)->is_val_positiveinfinity;    }       private mixed cast(string to) {    switch (to) {    case "string":    return "";    }    return UNDEFINED;    }       private string _sprintf(int fmt) {    return "+Infinity";    }   }    - //! The type for @[Val.neginfty]. + //! The type for @[neginfty].   class NegativeInfinity {    constant is_val_negativeinfinity = 1;       variant inline private int(0..1) `>(mixed that) {    return 0;    }       inline private mixed `+(mixed that) {    return objectp(that)    && (([object]that)->is_val_positiveinfinity || ([object]that)->is_val_nan) -  ? Val.nan : this; +  ? nan : this;    }       inline private mixed `*(mixed that) { -  return !that ? Val.nan : that > 0 ? this : Val.posinfty; +  return !that ? nan : that > 0 ? this : posinfty;    }       inline private mixed `/(mixed that) {    return !that || objectp(that) && (([object]that)->is_val_positiveinfinity    || ([object]that)->is_val_negativeinfinity) -  ? Val.nan : that > 0 ? this : Val.posinfty; +  ? nan : that > 0 ? this : posinfty;    }       private int(0..1) `==(mixed that) {    return objectp(that) && [int(0..1)]([object]that)->is_val_negativeinfinity;    }       private mixed cast(string to) {    switch (to) {    case "string":    return "";