Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX 11i Version 1.6 Release Notes: HP-UX Servers and Workstations > Chapter 7 Programming

C99 Floating Hexadecimal I/O Support in libc

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The strtod, printf, and scanf families of functions are enhanced to handle floating hexadecimal input and output. HP-UX 11i v1.6 delivers enhancements for C99 Floating Hexadecimal I/O support in libc.

Summary of Change

The strtod, printf, and scanf families of functions are enhanced to handle floating hexadecimal input and output.

Details of Change

APIs printf and scanf are enhanced to handle the new format specifiers 'a' and 'A' for floating hexadecimal input and output as specified in C99. The API strtod() is enhanced to accept floating hexadecimal sequences as specified in C99. These changes are extensions to existing functionality.

Impact

No impact.

Compatibility

The new scanf and strtod functions could affect the behavior of an existing program which depends on the rejection of input that the updated functions accept as a floating hexadecimal number. For example, the output of the following program:

#include <stdio.h>
int main() {
const char* input = "0x1p0z";
float x;
char c;
sscanf(input, "%e%c", &x, &c);
printf("x = %g\n", x);
printf("c = %c\n", c);

changes from:

x = 0 
c = x

to:

x = 1 
c = z

Performance

There is no change in performance.

Obsolescence

Not applicable.

Documentation

The manpages for printf(3S), scanf(3S) and strtod(3C) have been updated to reflect this enhancement.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2002 Hewlett-Packard Development Company, L.P.