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

Remove ini_hex and ini_HEX on 1.6+ #37

Merged
merged 5 commits into from
Sep 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/printf.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import Printf: ini_dec, fix_dec, ini_hex, ini_HEX
import Printf: ini_dec, fix_dec

if VERSION < v"1.1"
import Printf: ini_hex, ini_HEX

fix_dec(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char) = fix_dec(out, Float32(d), flags, width, precision, c)
ini_dec(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = ini_dec(out, Float32(d), ndigits, flags, width, precision, c)
ini_hex(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = ini_hex(out, Float32(d), ndigits, flags, width, precision, c)
ini_HEX(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = ini_HEX(out, Float32(d), ndigits, flags, width, precision, c)
ini_hex(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char) = ini_hex(out, Float32(d), flags, width, precision, c)
ini_HEX(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char) = ini_HEX(out, Float32(d), flags, width, precision, c)
else
fix_dec(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char, digits) = fix_dec(out, Float32(d), flags, width, precision, c, digits)
ini_dec(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = ini_dec(out, Float32(d), ndigits, flags, width, precision, c, digits)

if VERSION < v"1.6"
import Printf: ini_hex, ini_HEX

fix_dec(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char) = fix_dec(out, Float32(d), flags, width, precision, c)
ini_dec(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = ini_dec(out, Float32(d), ndigits, flags, width, precision, c)
ini_hex(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = ini_hex(out, Float32(d), ndigits, flags, width, precision, c)
Expand All @@ -14,4 +29,5 @@ else
ini_HEX(out, d::BFloat16, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = ini_HEX(out, Float32(d), ndigits, flags, width, precision, c, digits)
ini_hex(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char, digits) = ini_hex(out, Float32(d), flags, width, precision, c, digits)
ini_HEX(out, d::BFloat16, flags::String, width::Int, precision::Int, c::Char, digits) = ini_HEX(out, Float32(d), flags, width, precision, c, digits)
end
end