Bin Constructor (String, Single)Aerospike
Constructor, specifying bin name and float value. Aerospike server versions >= 3.6.0 natively support floating point values. If your cluster supports floating point values, then this is always the correct constructor for float. Remember to also set UseDoubleType to true;

If your cluster does not support floating point, the value is converted to long bits. On reads, it's important to call GetFloat(String) to indicate that the long returned by the server should be converted back to a float. If the same bin name holds different types for different records, then this constructor should not be used because there is no way to know when reading if the long should be converted to a float. Instead, use Bin(String, Object) which converts the float to a C# serialized blob.

float value = 22.7;
Bin bin = new Bin("mybin", (Object) value);

This is slower and not portable to other languages, but the float type is preserved, so a float will be returned without knowing if a conversion should be made.

For servers configured as "single-bin", enter a null or empty name.

Namespace: Aerospike.Client
Assembly: AerospikeClient (in AerospikeClient.dll) Version: 3.3.0.0 (3.3.1)
Syntax

See Also