1 dnl @ ../doc/m4.texi:6075: Origin of test
2 dnl @ expected status: 0
4 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
6 dnl @ This file is free software; the Free Software Foundation
7 dnl @ gives unlimited permission to copy and/or distribute it
8 dnl @ with or without modifications, as long as this notice
10 define(`foo', `The brown fox jumped over the lazy dog')
12 format(`The string "%s" uses %d characters', foo, len(foo))
13 dnl @result{}The string "The brown fox jumped over the lazy dog" uses 38 characters
14 format(`%*.*d', `-1', `-1', `1')
16 format(`%.0f', `56789.9876')
18 len(format(`%-*X', `5000', `1'))
20 ifelse(format(`%010F', `infinity'), ` INF', `success',
21 format(`%010F', `infinity'), ` INFINITY', `success',
22 format(`%010F', `infinity'))
24 ifelse(format(`%.1A', `1.999'), `0X1.0P+1', `success',
25 format(`%.1A', `1.999'), `0X2.0P+0', `success',
26 format(`%.1A', `1.999'))
28 format(`%g', `0xa.P+1')