mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2026-08-15 02:57:49 +04:00
17 lines
605 B
C#
17 lines
605 B
C#
using System.Diagnostics;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Common;
|
|
|
|
/// <summary>DEBUG ONLY. Одни и те же 4 байта, интерпретированные как int32 и float32.</summary>
|
|
/// <param name="AsInt">Значение как int32.</param>
|
|
/// <param name="AsFloat">Значение как float32.</param>
|
|
[DebuggerDisplay("AsInt = {AsInt}, AsFloat = {AsFloat}")]
|
|
public record class IntFloatValue(int AsInt, float AsFloat)
|
|
{
|
|
public IntFloatValue(Span<byte> span)
|
|
: this(MemoryMarshal.Read<int>(span), MemoryMarshal.Read<float>(span))
|
|
{
|
|
}
|
|
}
|