PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, August 11, 2022

[FIXED] What are the limits of the decimal type in XML Schema (XSD)?

 August 11, 2022     decimal, xml, xml-validation, xsd, xsd-validation     No comments   

Issue

What are the minimum and maximum acceptable values of the decimal type in XML Schema? (type="xs:decimal")?


Solution

XML Schema itself does not impose minimum and maximum values on xsd:decimal:

[Definition:] decimal represents arbitrary precision decimal numbers. The ·value space· of decimal is the set of the values i × 10^-n, where i and n are integers such that n >= 0.

[Contrast this with xsd:float, which corresponds to IEEE single-precision 32-bit floats.]

Implementations, on the other hand, may support limits to the range of xsd:decimal:

NOTE: All ·minimally conforming· processors ·must· support decimal numbers with a minimum of 18 decimal digits (i.e., with a ·totalDigits· of 18). However, ·minimally conforming· processors ·may· set an application-defined limit on the maximum number of decimal digits they are prepared to support, in which case that application-defined maximum number ·must· be clearly documented.

[For example, Xerces2-J uses java.math.BigDecimal; see How to get biggest BigDecimal value for answers on how big BigDecimal can be.]



Answered By - kjhughes
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing