timestampconstant以及转化为浮点数的特点(1)

2025-11-05 21:01:15

1、打开程序的后面板,此依次通过:

programming-timing获取timestamp constant;

通过:programming-numeric-conversion获取DBL。

timestampconstant以及转化为浮点数的特点(1)

timestampconstant以及转化为浮点数的特点(1)

1、我们直接将默认的时间戳常量转化为浮点数,可以看到结果显示为0;

注:但是默认的时间戳常量我们不知道数值是多少。

timestampconstant以及转化为浮点数的特点(1)

timestampconstant以及转化为浮点数的特点(1)

2、如果我们将timestamp const设置为:19040101 00:00:01:000;

浮点数显示为负数。

timestampconstant以及转化为浮点数的特点(1)

timestampconstant以及转化为浮点数的特点(1)

3、如果我们将timestamp const设置为:19040101 00:00:00:000;

我们可以看到浮点数仍然为负数,并且负数更小了。

注:前后我们只是减少了时间;

timestampconstant以及转化为浮点数的特点(1)

timestampconstant以及转化为浮点数的特点(1)

4、因此我们试图增加时间:我们将timestamp const设置为:19040101 08:00:00:000;

此时可以看到浮点数变为了0;

注1:当输入19040101 08:00:00:000 后,timestamp const会变成默认形态;

注2:可以看到我们已经设置了系统默认的绝对时间原点。

timestampconstant以及转化为浮点数的特点(1)

timestampconstant以及转化为浮点数的特点(1)

1、我们在绝对原点的基础上添加1s,可以看到浮点数变为了1;

至此,我们已经找到了timestamp 和浮点数转化的规律。

timestampconstant以及转化为浮点数的特点(1)

timestampconstant以及转化为浮点数的特点(1)

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢