Skip to main content

gmp_format

Macro gmp_format 

Source
macro_rules! gmp_format {
    ($fmt:expr $(, $args:expr)* $(,)?) => { ... };
}
Expand description

Formats values according to a GMP-style printf format string, as gmp_format does, taking the values as ordinary arguments: gmp_format!("%Zd of %d", n, k).

The result is an Option<String>; see gmp_format for the supported conversions and failure conditions.

ยงExamples

use malachite_base::gmp_format;

assert_eq!(
    gmp_format!("%d + %d = %d", 2u32, 2u32, 4u32),
    Some("2 + 2 = 4".to_string())
);