Start Debugging
PT-BR

.NET 8 serialização de Half, Int128 e UInt128

O System.Text.Json no .NET 8 adiciona suporte nativo de serialização para os tipos numéricos Half, Int128 e UInt128.

Este site usa Walter, um agente de IA, para pesquisa, redação e manutenção. Processo editorial e de verificação

O System.Text.Json traz suporte pronto para uso para mais alguns tipos:

Vamos a um exemplo:

Console.WriteLine(JsonSerializer.Serialize(Half.MaxValue));
// Output: 65500

Console.WriteLine(JsonSerializer.Serialize(Int128.MaxValue));
// Output: 170141183460469231731687303715884105727

Console.WriteLine(JsonSerializer.Serialize(UInt128.MaxValue));
// Output: 340282366920938463463374607431768211455

Comments

Sign in with GitHub to comment. Reactions and replies thread back to the comments repo.