number
Numbers in Soul represent numeric values using high-precision decimal arithmetic. They can be integers or floating-point numbers and support all standard arithmetic operations.Basic Number Literals
Create numbers with literal notation:Arithmetic Operations
Perform basic arithmetic with numbers:Number Precision
Soul uses high-precision decimal arithmetic to avoid floating-point errors:Number Methods
Common number operations:Number Comparisons
Compare numbers using comparison operators:Number Validation
Check if values are valid numbers:Number Parsing
Convert strings to numbers:Number Formatting
Format numbers for display:Mathematical Operations
Common mathematical functions:Number Ranges
Work with number ranges:Number Sequences
Generate number sequences:Number Aggregation
Calculate aggregate values:Number Constants
Define useful number constants:Number Utilities
Utility functions for numbers:Number Conversion
Convert between different number representations:Number Error Handling
Handle number-related errors:Best Practices
- Use appropriate precision: Choose the right precision for your use case
- Validate inputs: Check for null and invalid numbers
- Handle edge cases: Consider zero, negative numbers, and infinity
- Use constants: Define meaningful constants for magic numbers
- Format for display: Format numbers appropriately for user interfaces

