Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Petit bug de printf ? #3129

Closed
vicuna opened this issue Jan 7, 2002 · 1 comment
Closed

Petit bug de printf ? #3129

vicuna opened this issue Jan 7, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 7, 2002

Original bug ID: 782
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Est-ce normal que le comportement de %+d differe de celui de %+s dans
les formats de printf ? Le premier affiche le + (incorrect), mais pas
le second...

  • Fabrice
@vicuna
Copy link
Author

vicuna commented Jan 7, 2002

Comment author: administrator

Est-ce normal que le comportement de %+d differe de celui de %+s dans
les formats de printf ? Le premier affiche le + (incorrect), mais pas
le second...

Parfaitement normal:

Printf.printf "%+d\n" 123;;

+123

  • : unit = ()

Printf.printf "%+d\n" (-123);;

-123

  • : unit = ()

Printf.printf "%+s\n" "hello";;

hello

  • : unit = ()

man 3 printf:

   +      A  sign  (+  or -) always be placed before a number
          produced by a signed conversion.  By default a sign
          is  used only for negative numbers. A + overrides a
          space if both are used.
  • Xavier

@vicuna vicuna closed this as completed Jan 8, 2002
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant