Skip to content

csharp负数问题 #4

@spaceming

Description

@spaceming

请问负数是不是不支持?测试发现float和double都不支持
OutputStream.cs
public void WriteFloat(int fieldIndex, float value)
{
if (value < float.Epsilon)//这里直接返回了
{
return;
}

        WriteTag(fieldIndex, WireFormat.WireType.Fixed32);

        CheckBuffer(4);
        if(value < 0){
            value = value;
        }
        FastBitConverter.GetBytes(_buffer, _pos, value);
        _pos += 4;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions