askill
numeric-data-processing-standards

numeric-data-processing-standardsSafety 95Repository

Provides comprehensive guidelines for handling numeric data in code, including data type selection, magic number avoidance, type conversions, and boundary checks. Use this skill when writing or reviewing code that involves numeric variables, constants, calculations, or comparisons to prevent type errors, overflow, and runtime exceptions.

11 stars
1.2k downloads
Updated 1/27/2026

Package Files

Loading files...
SKILL.md

Numeric Data Processing Standards

When to Use

Apply this skill when:

  • Defining numeric variables or constants
  • Performing numeric calculations or operations
  • Comparing numeric values
  • Converting between data types
  • Reviewing code for potential numeric-related defects

Core Procedures

1. Data Type Selection and Declaration

  • Choose appropriate data type based on requirements (BCD, floating-point, integer)
  • Review compiler warnings related to data types
  • Add explanatory comments when declaring variables
  • Define portable data types for cross-platform compatibility

2. Literals and Magic Number Handling

  • Replace literal numbers with named constants
  • Avoid hardcoded 0 and 1 except when semantically appropriate
  • Eliminate "magic numbers" by using descriptive constant names

3. Numeric Operations and Conversions

  • Handle numeric type conversions explicitly
  • Avoid comparisons between mixed types
  • Prevent operations on numbers with vastly different magnitudes
  • Consider computational cost of common operations

4. Error Prevention and Boundary Checks

  • Implement integer overflow protection
  • Validate integer ranges before operations
  • Prevent division by zero errors
  • Apply boundary analysis to avoid off-by-one errors

Key Considerations

  • Type Safety: Always verify type compatibility before operations
  • Precision: Be aware of floating-point precision limitations
  • Portability: Use type definitions that work across platforms
  • Performance: Balance safety with computational efficiency
  • Readability: Named constants improve code maintainability

Common Pitfalls to Avoid

  • Implicit type conversions that lose precision
  • Comparing floating-point numbers for exact equality
  • Assuming integer overflow behavior across compilers
  • Using magic numbers without documentation
  • Ignoring compiler warnings about type mismatches

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

78/100Analyzed 2/20/2026

Solid skill document providing comprehensive guidelines for numeric data processing with clear structure and actionable procedures. Well-organized with When to Use section and detailed procedures covering data types, literals, operations, and error prevention. Slightly reduced score due to lack of code examples and being from a samples directory. High safety and reusability, good clarity."

95
85
80
70
70

Metadata

Licenseunknown
Version-
Updated1/27/2026
Publisherkitchen-engineer42

Tags

No tags yet.