SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
NumberMatch.h File Reference

Doxygen only documents namespace-scope entities (enums, aliases, constants, free functions) in a header that carries this block. More...

Enumerations

enum class  sfs3::entities::match::NumberMatch {
  EQUALS , NOT_EQUALS , GREATER_THAN , GREATER_THAN_OR_EQUAL_TO ,
  LESS_THAN , LESS_THAN_OR_EQUAL_TO
}
 The NumberMatch conditions are used in matching expressions to check numeric values. More...

Functions

const char * sfs3::entities::match::symbolOf (NumberMatch condition)
 Returns the condition symbol of the passed matcher, as sent to the server and rendered by MatchExpression::toString().

Detailed Description

Doxygen only documents namespace-scope entities (enums, aliases, constants, free functions) in a header that carries this block.

Enumeration Type Documentation

◆ NumberMatch

The NumberMatch conditions are used in matching expressions to check numeric values.

NOTE: every numeric comparison is performed on double values. The value passed to the matching expression travels on the wire as a double, and the server widens the variable or property it is compared against to a double too, whatever its declared type (byte, short, int, long, float or double). Two consequences are worth knowing:

  • comparing a float variable with EQUALS is unreliable, because widening a float to a double exposes its binary representation error (a variable holding 0.1f becomes 0.10000000149011612, which does not equal the 0.1 sent from here). Prefer a range comparison;
  • integer values above 2^53 lose precision, so two distinct values may compare as equal.
See also
MatchExpression
Enumerator
EQUALS 

Represents the following condition: number1 == number2.

NOT_EQUALS 

Represents the following condition: number1 != number2.

GREATER_THAN 

Represents the following condition: number1 > number2.

GREATER_THAN_OR_EQUAL_TO 

Represents the following condition: number1 >= number2.

LESS_THAN 

Represents the following condition: number1 < number2.

LESS_THAN_OR_EQUAL_TO 

Represents the following condition: number1 <= number2.