import protobuf.type.scalar

namespace protobuf.type;
 
class double{ 

	ctor(...) {
		this = ..protobuf.type.scalar(...)
		this.wiredType = ..protobuf.message.wiredType64Bit;
	}; 
	deSerialize = function () {
		var value = this.reader.next64bit();
		this.value = ..raw.convert({BYTES bin[8] = value},{double d}).d;
	};
	serialize = function ( rec=-1 ) { 
		var str = '';
		if ( rec > -1) {
			str ++= this.encodeVarUint64( rec << 3 | this.wiredType );
		}
		
		this.value = tonumber(this.value) : 0;
		return str ++ ..raw.convert({double d = this.value },{BYTES bin[8] }).bin;
	}
}
