Lines Matching defs:value
46 // Returns true if the given value is any kind of infinity.
53 // Returns the maximum normal value.
55 // Returns the lowest normal value.
65 // a value is Nan.
75 // Returns true if the given value is any kind of infinity.
77 // Returns the maximum normal value.
79 // Returns the lowest normal value.
81 // Returns the value as the native floating point format.
95 // Returns true if the given value is any kind of infinity.
97 // Returns the maximum normal value.
99 // Returns the lowest normal value.
101 // Returns the value as the native floating point format.
117 // Returns true if the given value is any kind of infinity.
119 // Returns the maximum normal value.
121 // Returns the lowest normal value.
123 // Returns the value as the native floating point format.
157 // Returns the data as a floating point value.
176 // Returns true if the value represents any type of NaN.
178 // Returns true if the value represents any type of infinity.
181 // Returns the maximum normal value.
185 // Returns the lowest normal value.
199 // Reads a FloatProxy value as a normal float from a stream.
201 std::istream& operator>>(std::istream& is, FloatProxy<T>& value) {
204 value = FloatProxy<T>(float_val);
230 // value to get the correct value.)
286 // assist in interpreting the bits of the value.
297 T value() const { return value_; }
358 // Returns the bits associated with the value.
361 // Returns the bits associated with the value, without the leading sign bit.
379 // Returns just the significand bits from the value.
413 // Returns true if this number represents a negative value.
634 // Casts this value to another HexFloat. If the cast is widening,
646 other.set_value(-other.value());
703 // zero out any underflowing value (but retain the sign).
739 std::ostream& operator<<(std::ostream& os, const HexFloat<T, Traits>& value) {
751 const uint_type bits = value.value().data();
812 // on the stream and set the value to the zero value for its type.
815 HexFloat<T, Traits>& value) {
819 // Fail the parse. Emulate standard behaviour by setting the value to
820 // the zero value, and set the fail bit on the stream.
821 value = HexFloat<T, Traits>(typename HexFloat<T, Traits>::uint_type{0});
830 // value parameter.
833 // being stored into the value parameter.
834 // If the value cannot be correctly parsed or overflows the target floating
836 // TODO(dneto): Promise C++11 standard behavior in how the value is set in
841 HexFloat<T, Traits>& value) {
842 if (RejectParseDueToLeadingSign(is, negate_value, value)) {
850 value.set_value(val);
852 if (is.fail() && value.getUnsignedBits() == 0u) {
853 value = HexFloat<T, Traits>(typename HexFloat<T, Traits>::uint_type{0});
856 // Fail the parse. Emulate standard behaviour by setting the value to
857 // the closest normal value, and set the fail bit on the stream.
858 value.set_value((value.isNegative() | negate_value) ? T::lowest()
867 // and then round it down to fit into a Float16 value.
871 // being stored into the value parameter.
872 // If the value cannot be correctly parsed or overflows the target floating
874 // TODO(dneto): Promise C++11 standard behavior in how the value is set in
881 HexFloat<FloatProxy<Float16>, HexFloatTraits<FloatProxy<Float16>>>& value) {
888 float_val.castTo(value, round_direction::kToZero);
891 // fail bit and set the lowest or highest value.
892 if (Float16::isInfinity(value.value().getAsFloat())) {
893 value.set_value(value.isNegative() ? Float16::lowest() : Float16::max());
901 // Returns a new value formed from 'value' by setting 'bit' that is the
904 // type, then return the original value.
906 UINT_TYPE set_nth_most_significant_bit(UINT_TYPE value, UINT_TYPE bit,
910 return static_cast<UINT_TYPE>(value | (bit << (max_position - n)));
912 return value;
919 bool saturated_inc(INT_TYPE& value) {
920 if (value == std::numeric_limits<INT_TYPE>::max()) {
923 value++;
931 bool saturated_dec(INT_TYPE& value) {
932 if (value == std::numeric_limits<INT_TYPE>::min()) {
935 value--;
960 std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
965 value.set_value(static_cast<typename HF::native_type>(0.f));
978 return ParseNormalFloat(is, negate_value, value);
992 return ParseNormalFloat(is, negate_value, value);
997 return ParseNormalFloat(is, negate_value, value);
1110 // The magnitude of the exponent, as written, or the sentinel value to signal
1113 // A sentinel value signalling overflow of the magnitude of the written
1222 value.set_value(output_float);
1227 // Writes a FloatProxy value to a stream.
1229 // enough digits to fully reproduce the value. Other values (subnormal,
1232 std::ostream& operator<<(std::ostream& os, const FloatProxy<T>& value) {
1233 auto float_val = value.getAsFloat();
1243 os << HexFloat<FloatProxy<T>>(value);
1251 const FloatProxy<Float16>& value) {
1252 os << HexFloat<FloatProxy<Float16>>(value);