Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Occurrence  





2 Advantages  



2.1  Collation  





2.2  Error prevention  





2.3  Fraud prevention  







3 Zero as a prefix  





4 See also  





5 References  














Leading zero






Deutsch
עברית
Nederlands
Português
Русский
Slovenščina
Српски / srpski
Українська
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Aleading zero is any 0 digit that comes before the first nonzero digit in a number string in positional notation.[1] For example, James Bond's famous identifier, 007, has two leading zeros.[2] Any zeroes appearing to the left of the first non-zero digit (of any integer or decimal) do not affect its value, and can be omitted (or replaced with blanks) with no loss of information.[3] Therefore, the usual decimal notation of integers does not use leading zeros except for the zero itself, which would be denoted as an empty string otherwise.[4] However, in decimal fractions strictly between −1 and 1, the leading zeros digits between the decimal point and the first nonzero digit are necessary for conveying the magnitude of a number and cannot be omitted,[1] while trailing zeros – zeros occurring after the decimal point and after the last nonzero digit – can be omitted without changing the meaning.

Occurrence

[edit]
A municipal bridge number with a leading zero

Often, leading zeros are found on non-electronic digital displays or on such electronic ones as seven-segment displays, that contain fixed sets of digits. These devices include manual counters, stopwatches,[5] odometers,[6] and digital clocks.[5] Leading zeros are also generated by many older computer programs when creating values to assign to new records, accounts and other files, and as such are likely to be used by utility billing systems, human resources information systems and government databases. Many digital cameras and other electronic media recording devices use leading zeros when creating and saving new files to make names of the equal length.

Leading zeros are also present whenever the number of digits is fixed by the technical system (such as in a memory register), but the stored value is not large enough to result in a non-zero most significant digit.[7] The count leading zeros operation efficiently determines the number of leading zero bits in a machine word.[8]

Leading zeros can have its meaning for various reasons:

A leading zero appears in roulette in the United States, where "00" is distinct from "0" (a wager on "0" will not win if the ball lands in "00", and vice versa). Sports where competitors are numbered follow this as well; a stock car numbered "07" would be considered distinct from one numbered "7". Benito Santiago, a Major League Baseball catcher who wore the number 09 for several years, is the only major professional sports league player to use a jersey number with a leading zero, not counting several who have worn the number 00 (he wore the extra zero to avoid complications with his catcher's pads, allowing the back strap to run between the numbers instead of over a single digit 9). Dennis Rodman had requested the number 01 when he joined the Chicago Bulls (as his usual number 10 had already been retired), but the National Basketball Association forbade it, and Rodman instead wore 91.[9]

In most countries other than the United States, numbers between 0 and 1, expressed as a decimal, include a zero before the decimal point (e.g. 0.64 or in many countries 0,64) while in the United States this zero is often omitted (.64).

Advantages

[edit]

Collation

[edit]

Leading zeros are used to make ascending order of numbers correspond with alphabetical order: e.g., 11 comes alphabetically before 2, but after 02. (See, e.g., ISO 8601.) This does not work with negative numbers, though, whether leading zeros are used or not: −23 comes alphabetically after −01, −1, and −22, although it is less than all of them.

Error prevention

[edit]

Leading zeros in a sentence also make it less likely that a careless reader will overlook the decimal point. For example, in modern pharmacy there is a widely followed convention that leading zeros before a decimal must not be omitted from any dose or dosage value in drug prescribing (e.g. 0.2 mg must be used, not .2 mg). Meanwhile, trailing zeros are forbidden (e.g. 2 mg must be used, not 2.0 mg). In both cases, the intention is to prevent misreading and the resultant misdose by one or several orders of magnitude.[10]

Fraud prevention

[edit]

Leading zeros can also be used to prevent fraud by filling in character positions that might normally be empty. For example, adding leading zeros to the amount of a check (or similar financial document) makes it more difficult for fraudsters to alter the amount of the check before presenting it for payment.

Zero as a prefix

[edit]

A prefix 0 is used in C to specify string representations of octal numbers, as required by the ANSI C standard for the strtol() function (which converts strings to long integers) in the <stdlib.h> library.[11] Many other programming languages, such as Python, Perl, Ruby, PHP, and the Unix shell bash also follow this specification for converting strings to numbers. As an example, "0020" does not represent 2010 (2×101 + 0×100), but rather 208 = 1610 (2×81 + 0×80 = 1×101 + 6×100). Decimal numbers written with leading zeros will be interpreted as octal by languages that follow this convention and will generate errors if they contain "8" or "9", since these digits do not exist in octal. This behavior can be a nuisance when working with sequences of strings with embedded, zero-padded decimal numbers (typically file names) to facilitate alphabetical sorting (see above) or when validating inputs from users who would not know that adding a leading zero triggers this base conversion.

House number in Prague with a leading zero as a prefix indicating a special house number series for recreational and provisional buildings

In Czechia, a zero prefix was formerly used as one of ways how to indicate a type of house number. As the standard house numbers, conscription house numbers (čísla popisná) are used. However, for temporary and recreational structures, a special number series of registration house numbers (čísla evidenční) is used. This type is distinguished by any prefix (0, E or N), by a distinbuishing text or abbreviation or by color of the sign.

See also

[edit]

References

[edit]
  1. ^ a b Miller, Jane E. (2008), The Chicago Guide to Writing about Numbers, University of Chicago Press, p. 276, ISBN 9780226526324.
  • ^ Lafore, Robert W. (1987), Microsoft C: programming for the IBM, H.W. Sams, p. 294, ISBN 9780672225154.
  • ^ Zegarelli, Mark (2014), Basic Math and Pre-Algebra Workbook For Dummies (2nd ed.), John Wiley & Sons, p. 8, ISBN 9781118828304.
  • ^ Flynt, Clif (2012), Tcl/Tk: A Developer's Guide, Elsevier, pp. 752–753, ISBN 9780123847171.
  • ^ a b Greene, Jennifer; Stellman, Andrew (2013), Head First C#, O'Reilly Media, Inc., p. 770, ISBN 9781449358884.
  • ^ Dueck, Robert; Reid, Ken (2011), Digital Electronics, Cengage Learning, p. 48, ISBN 9781133708964.
  • ^ Kuc, Roman (1999), The digital information age: an introduction to electrical engineering, PWS Pub. Co., p. 67, ISBN 9780534953157.
  • ^ Dandamudi, Sivarama P. (2005), Guide to RISC Processors: for Programmers and Engineers, Springer, p. 139, ISBN 9780387274461.
  • ^ Armour, Terry. Joining Bulls `Almost Like A Storybook' For Former Collins Prep Brown Archived June 4, 2015, at the Wayback Machine. October 6, 1995
  • ^ Davis, Neil M. (2005). Medical Abbreviations: 26,000 Conveniences at the Expense of Communication and Safety (12th ed.). Warminster, PA: Neil M. Davis Associates. p. 7. ISBN 0931431123.
  • ^ Kernighan, Brian; Ritchie, Dennis M. (March 1988). The C Programming Language (2nd ed.). Englewood Cliffs, NJ: Prentice Hall. p. 252. ISBN 0-13-110362-8.

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Leading_zero&oldid=1230730878"

    Categories: 
    Computer data
    Digital electronics
    Numeral systems
    0 (number)
    Hidden categories: 
    Webarchive template wayback links
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 24 June 2024, at 11:13 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki